package com.authine.cloudpivot.ext.enums.system;

import java.util.Arrays;
import java.util.List;

/**
 * 组织属性枚举类
 */
public enum OrganizationAttributeEnum {

    DEMAND_APPROVAL(0, ArchitectureCateEnum.CUSTOMER, "需求审批"),
    INQUIRY_APPROVAL(1, ArchitectureCateEnum.CUSTOMER, "询价审批"),
    QUOTATION_APPROVAL(2, ArchitectureCateEnum.VENDOR, "报价审批"),
    PICKET_AGE_APPROVAL(3, ArchitectureCateEnum.CUSTOMER, "定标审批"),
    ORDER_APPROVAL(4, ArchitectureCateEnum.CUSTOMER, "订单审批"),
    PAYMENT_APPROVAL(5, ArchitectureCateEnum.CUSTOMER, "付款审批"),
    GOODS_APPROVAL(6, ArchitectureCateEnum.CUSTOMER, "商品审批"),
    INQUIRY_INVITED(7, ArchitectureCateEnum.VENDOR, "仅邀请组织可报价"),
    STRATEGY_MORE(8, ArchitectureCateEnum.VENDOR, "采购量大于等于询价量"),
    QUOTATION_DELIVERY(9, ArchitectureCateEnum.VENDOR, "报价货期限制"),
    INVOICE_ORDER_AFTER(10, ArchitectureCateEnum.CUSTOMER, "订单收货后开票"),
    RECEIVE_ALL_GOODS(11, ArchitectureCateEnum.CUSTOMER, "整单收货"),
    UNDO_RECONCILIATION_INVOICE(12, ArchitectureCateEnum.VENDOR, "未对账可开票"),
    UNDO_INVOICE_SETTLE(13, ArchitectureCateEnum.VENDOR, "未开票可结算"),
    AUTO_RECEIVE_RECONCILIATION(14, ArchitectureCateEnum.CUSTOMER, "收货后自动对账"),
    UNDO_RECEIVE_RECONCILIATION(15, ArchitectureCateEnum.CUSTOMER, "未收货是否可对账"),
    VERIFY_CAN_BATCH_RECONCILIATION(16, ArchitectureCateEnum.CUSTOMER, "是否可以分批对账"),
    VERIFY_CAN_BATCH_INVOICE(17, ArchitectureCateEnum.CUSTOMER, "是否可以分批开票"),
    SELF_LOOP_PURCHASE(18, ArchitectureCateEnum.CUSTOMER, "年度采购权限"),
    //竞争关系供应商
    PARTICIPTION_INVITED(19, ArchitectureCateEnum.VENDOR, "仅邀请组织可见（竞争关系属性）"),
    WHOLE_RECONCILIATION(20, ArchitectureCateEnum.VENDOR, "整单对账"),
    WHOLE_INVOICE(21, ArchitectureCateEnum.VENDOR, "整单开票"),
    WHOLE_SETTLE(22, ArchitectureCateEnum.VENDOR, "整单结算"),
    VERIFY_CAN_BATCH_VENDOR_INFO(23, ArchitectureCateEnum.CUSTOMER, "是否不看供应商信息"),
    VAT_QUOTATION(24, ArchitectureCateEnum.CUSTOMER, "客户是否需要含税报价"),
    VERIFY_QUOTEHERMETICSTRATEGY(25, ArchitectureCateEnum.CUSTOMER, "是否默认是密封报价"),
    ORDER_SMS_REMIND(26, ArchitectureCateEnum.CUSTOMER, "下单短信提醒"),
    ORDER_MAIL_REMIND(27, ArchitectureCateEnum.CUSTOMER, "下单邮件提醒"),
    SPLIT_GOODS(28, ArchitectureCateEnum.CUSTOMER, "客户是否需要拆分商品"),
    VIEW_RECONCILIATION(29, ArchitectureCateEnum.CUSTOMER, "分级对账"),
    SHARE_INVITE_VENDORS(30, ArchitectureCateEnum.CUSTOMER, "共享邀请供应商"),
    REQUEST_EXPORT_QUOTATION(31, ArchitectureCateEnum.CUSTOMER, "需求人是否可导出报价"),
    OVERDUE_BUT_NOT_INVOICED(32, ArchitectureCateEnum.CUSTOMER, "超期未申票限制"),
    INQUIRY_MAIL_END(33, ArchitectureCateEnum.CUSTOMER, "询价截止是否发送邮件"),
    DEMAND_ASSIGN_BUYER(34, ArchitectureCateEnum.CUSTOMER, "需求是否指定采购员"),
    // 子组织加父组织查询权限
    SON_PLUS_FATHER(35, ArchitectureCateEnum.CUSTOMER, "子组织查询父组织多次采购目录"),
    MULTIPLE_PURCHASES(36, ArchitectureCateEnum.CUSTOMER, "是否默认多次购买"),
    DEPARTMENT_SHARE_PURCHASES(37, ArchitectureCateEnum.CUSTOMER, "部门共享企业采购目录"),
    AUTO_MATCH_QUOTATION(38, ArchitectureCateEnum.CUSTOMER, "自动匹配报价"),
    GOODS_NUMBER_ADJUST(39, ArchitectureCateEnum.CUSTOMER, "企业采购目录数量调整"),
    NO_MIXED_ORDER(40, ArchitectureCateEnum.CUSTOMER, "禁止混合下单"),
    ACCEPT_REPLACE_GOODS(41, ArchitectureCateEnum.CUSTOMER, "是否接受替代商品"),
    VENDOR_QUOTATION_QUALIFICATION_VERIFY(42, ArchitectureCateEnum.VENDOR, "供应商报价资质认证");


    private Number code;
    private ArchitectureCateEnum architecturecateEnum;
    private String des;

    OrganizationAttributeEnum(Number code, ArchitectureCateEnum architecturecateEnum, String des) {
        this.code = code;
        this.des = des;
        this.architecturecateEnum = architecturecateEnum;
    }

    public ArchitectureCateEnum getArchitectureCateEnum() {
        return architecturecateEnum;
    }

    public void setArchitectureCateEnum(ArchitectureCateEnum architecturecateEnum) {
        this.architecturecateEnum = architecturecateEnum;
    }

    public Number getCode() {
        return code;
    }

    public void setCode(Number code) {
        this.code = code;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    @Override
    public String toString() {
        return "OrganizationAttributeEnum{" +
                "code=" + code +
                ", architectureCateEnum=" + architecturecateEnum +
                ", des='" + des + '\'' +
                '}';
    }

    static class Attributes {
        private ArchitectureCateEnum architectureCateEnum;
        private OrganizationAttributeEnum name;
        private Number code;
        private String des;

        public Attributes(OrganizationAttributeEnum name, ArchitectureCateEnum architectureCateEnum, Number code, String des) {
            this.name = name;
            this.code = code;
            this.des = des;
            this.architectureCateEnum = architectureCateEnum;
        }

        public OrganizationAttributeEnum getName() {
            return name;
        }

        public void setName(OrganizationAttributeEnum name) {
            this.name = name;
        }

        public Number getCode() {
            return code;
        }

        public void setCode(Number code) {
            this.code = code;
        }

        public String getDes() {
            return des;
        }

        public void setDes(String des) {
            this.des = des;
        }

        public ArchitectureCateEnum getArchitectureCateEnum() {
            return architectureCateEnum;
        }

        public void setArchitecturecateEnum(ArchitectureCateEnum architectureCateEnum) {
            this.architectureCateEnum = architectureCateEnum;
        }

        @Override
        public String toString() {
            return "Attributes{" +
                    "architectureCateEnum=" + architectureCateEnum +
                    ", name=" + name +
                    ", code=" + code +
                    ", des='" + des + '\'' +
                    '}';
        }
    }

    public static List<OrganizationAttributeEnum> listAttributes() {
        return Arrays.asList(OrganizationAttributeEnum.class.getEnumConstants());
    }

}
